﻿<!DOCTYPE html>

<html class="x-admin-sm">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width" />
    <title>AgentIncomesList</title>
    <link rel="stylesheet" href="~/css/font.css">
    <link rel="stylesheet" href="~/css/xadmin.css">
    @*<script src="~/jquery/dist/jquery.min.js"></script>*@
    <script src="~/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="~/js/xadmin.js"></script>
</head>
<body>
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
      <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
      <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <div class="x-nav">
        <span class="layui-breadcrumb">
            <a href="">首页</a>
            <a href="">代理商收益列表</a>
            <a>
                <cite>代理商收益列表</cite>
            </a>
        </span>
        <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" onclick="location.reload()" title="刷新">
            <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i>
        </a>
    </div>
    <div class="layui-fluid">
        @* 布局类 使用此类不会固定宽度，而是 100%自适应*@
        <div class="layui-row layui-col-space15">
            @* 设置行  列之间间隔 15px*@
            <div class="layui-col-md12">
                @* 设置列  12等分*@
                <div class="layui-card">
                    <div class="layui-card-body ">
                        <table class="layui-table" id="goodstypetablelist" lay-filter="goodstypetablelist"></table>

                    </div>
                </div>
            </div>
        </div>
    </div>    
    <script type="text/javascript">
        layui.use(['table'], function () {
            var table = layui.table;
            var options = {
                elem: '#goodstypetablelist'
                , method: 'post'
                , toolbar: '#toolbar'
                , height: 'full-170'
                , url: '/AgentIncomes/AgentIncomesList/'
                , page: {
                    layout: ['limit', 'count', 'prev', 'page', 'next', 'skip']
                }
                , limit: 20
                , limits: [20, 40, 60, 80, 100]
                , cols: [[
                    //{ field: 'id', title: '编号', width: 80 },
                     { field: 'userName', title: '用户名称' }
                    , { field: 'productName', title: '产品名称' }
                    , { field: 'amount', title: '收益(BTC)' }
                    //, { fixed: '', title: '操作', toolbar: '#opbar' }
                ]]
            };
            var goodstypeTable = table.render(options);
            //搜索事件
            $('#searchbtn').on('click', function () {
                tableReload();
            });

            //刷新表格数据
            var tableReload = function () {
                goodstypeTable.reload({
                    where: {
                        name: $('#goodstypename').val().trim()
                    },
                    page: {
                        curr: 1
                    }
                })
            }
            //打开新窗口
            var openlayer = function (title, url, w, h, full) {
                if (title == null || title == '') {
                    var title = false;
                };
                if (url == null || url == '') {
                    var url = "404.html";
                };
                if (w == null || w == '') {
                    var w = ($(window).width() * 0.9);
                };
                if (h == null || h == '') {
                    var h = ($(window).height() - 50);
                };
                var index = layer.open({
                    type: 2,
                    area: [w + 'px', h + 'px'],
                    fix: false, //不固定
                    maxmin: true,
                    shadeClose: true,
                    shade: 0.4,
                    title: title,
                    content: url,
                    end: function () {
                        tableReload();
                    }
                });
                if (full) {
                    layer.full(index);
                }
            }
        });
    </script>
</body>
</html>

